/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package compilador.datos;

import java.util.Hashtable;

/**
 *
 * @author Iñaki Goffard
 */
public class Registro extends ExprTipos {

    private String tipo;

    private Hashtable campos;

    private String clase;
    private int dir;//Dirección de comienzo
    private int tam;
    private int desp;

    public Registro (String tipo,Hashtable campos,int tam){
        this.tipo = tipo;
        this.campos = campos;
        this.tam = tam;
    }

    @Override
    public String getTipo(){
        return this.tipo;
    }

     @Override
    public void setClase(String clase){
        this.clase = clase;
    }

    @Override
    public String getClase(){
        return this.clase;
    }

    @Override
    public void setTam (int tam){
        this.tam = tam;
    }

    @Override
    public int getTam (){
        return tam;
    }

    @Override
    public void setDesp (int desp){
        this.desp = desp;
    }

    @Override
    public int getDesp (){
        return this.desp;
    }

    public int getNumCampos(){
        return this.campos.size();
    }

    public Hashtable getCampos(){
        return this.campos;
    }

    @Override
    public String toString() {
        return "Mi tipo es: " + this.tipo;
    }
}
